<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>${message("添加机构")}</title>
<link href="/resources/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/resources/js/reference/jquery.js"></script>
<script type="text/javascript" src="/resources/js/base/dialog.js"></script>
<script type="text/javascript" src="/resources/js/base/request.js"></script>
<script type="text/javascript" src="/resources/js/base/global.js"></script>
<script type="text/javascript" src="/resources/js/reference/jquery.validate.js"></script>
<script type="text/javascript" src="/resources/js/reference/mmGrid.js"></script>
<link href="/resources/css/mmGrid.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$().ready(function() {
		
	$inputForm = $("#inputForm");
		
		// 表单验证
	$inputForm.validate({
		rules: {
    		name: "required",	
    		sn: "required",	
		} ,
		submitHandler:function(form){
			return false;
		}
	});
		
	//查询机构
	$("#selectSaleOrg").bindQueryBtn({
		type:'saleOrg',
		title:'${message("查询机构")}',
		url:'/saleOrg/select_saleOrg.jhtml'
	});
	$("form").bindAttribute({
		isConfirm:true,
	    callback: function(resultMsg){
	        $.message_timer(resultMsg.type,resultMsg.content,1000,function(){
				location.href= 'edit.jhtml?id='+resultMsg.objx;
			})
	    }
	 });
});
</script>
</head>
<body>
	<div class="pathh">
		&nbsp;${message("新增机构")}
	</div>
	<form id="inputForm" action="save.jhtml" method="post" type="ajax" validate-type="validate">
		<input  type="hidden" name="isTop" value="false"/>
		<div class="tabContent">
		<table class="input input-edit">
			<tr>
				<th>
					<span class="requiredField"></span>${message("机构类型")}:
				</th>
				<td>
					<select name="type" class="text">
						<option value="0">${message("公司") }</option>
						<option value="1">${message("客户") }</option>
						<option value="2">${message("油库") }</option>
					</select>
				</td>
				<th>${message("上级机构")}:</th>
				<td>
					<span class="search" style="position:relative">
					<input type="hidden" name="saleOrgId" class="text saleOrgId" btn-fun="clear" value="${parent.id}"/>
					<input type="text" name="saleOrgName" class="text saleOrgName" maxlength="200" onkeyup="clearSelect(this)" value="${parent.name}" readOnly/>
					<input type="button" class="iconSearch" value="" id="selectSaleOrg">
					</span>
				</td>
				<th>
					<span class="requiredField">*</span>${message("机构名称")}:
				</th>
				<td>
					<input type="text" name="name" class="text" maxlength="200"   btn-fun="clear" />
				</td>
				<!--
				<th>
					${message("费用预算")}:
				</th>
				<td>
					<span style="color:#f60;">${currency(0, true)}</span>
				</td>
				-->
				<th>
					<span class="requiredField">*</span>${message("机构编号")}:
				</th>
				<td>
					<input type="text" name="sn" class="text" maxlength="200"   btn-fun="clear" />
				</td>
			</tr>
			<tr>
				<th>
					${message("11092")}:
				</th>
				<td>
					<label>
						<input type="checkbox" name="isEnabled" value="true" checked="checked" />是否启用
						<input type="hidden" name="_isEnabled" value="false" />
					</label>
				</td>
				<th class="noBg"></th><td colspan="5"></td>
			</tr>
			<tr>
				<th>
					${message("备注")}:
				</th>
				<td colspan="7">
					<textarea name="memo" class="text"></textarea>
				</td>
			</tr>
		</table>
		</div>
		<div class="fixed-top">
			<input type="submit" id="submit_button" class="button sureButton" value="${message("1013")}" />
			<input type="button" onclick="location.reload(true);" class="button resetButton ml15" value="${message("重置")}">
		</div>
	</form>
</body>
</html>